#ifndef VIDEO_H
#define VIDEO_H

#include <stdint.h>

#define VIDEO_CHUNK_SIZE 512
#define MAX_FRAME_BUFFER 2

typedef struct {
    uint16_t width;
    uint16_t height;
    uint8_t format;
    uint32_t timestamp;
    uint8_t *data;
    uint32_t data_size;
} VideoFrame;

typedef struct {
    VideoFrame frames[MAX_FRAME_BUFFER];
    uint8_t write_index;
    uint8_t read_index;
} VideoBuffer;

int video_init(const char *device);
void video_cleanup();
int video_capture_frame(VideoFrame *frame);
uint32_t compress_frame(const VideoFrame *src, uint8_t *dest);

#endif // VIDEO_H